package com.evil.application.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.evil.application.pojo.entity.FavouriteApplication;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Optional;

/**
 * 用户常用应用表
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
public interface FavouriteApplicationMapper extends BaseMapper<FavouriteApplication> {

    int batchInsert(@Param("list") List<FavouriteApplication> list);

    Optional<FavouriteApplication> findUserApp(@Param("userId") Long userId, @Param("applicationId") Long applicationId);

    List<FavouriteApplication> findByUserId(@Param("enterpriseId") Long enterpriseId,
                                            @Param("userId") Long userId,
                                            @Param("favourite") Integer favourite);

    List<FavouriteApplication> findByApplicationId(@Param("applicationId") Long applicationId, @Param("favourite") Integer favourite);
}